package com.wrs.examsystem.service;

import com.wrs.examsystem.entity.Result.R;
import com.wrs.examsystem.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wrs.examsystem.entity.bean.EnrollBean;
import com.wrs.examsystem.entity.bean.LoginBean;
import com.wrs.examsystem.entity.bean.NewUserBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 王荣升
 * @since 2024-05-15
 */
@Service
public interface UserService extends IService<User> {
    /**
     * 登录逻辑模块
     * @param loginBean 登录类
     * @return
     */
    public R login(LoginBean loginBean);

    /**
     * 注册逻辑模块
     * @param enrollBean 注册类
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public R enroll(EnrollBean enrollBean);

    public R checkUser(NewUserBean newUserBean);
    public R updateByName(String username);

    public R updateInformation(EnrollBean enrollBean);

}
